home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / RTX2000.ZIP / rtx2000 / monitor / main < prev    next >
Text File  |  1992-12-02  |  3KB  |  93 lines

  1. ( ************************** RTX2000 Debug Monitor  **********************
  2.   This is source code for a public domain debug monitor that is compatible
  3.   with the output of the fc compiler.   The monitor is ASCII
  4.   character based and can be used with a terminal emulation program on 
  5.   either an IBM PC or AMIGA if a serial interface is used for I/O on the 
  6.   target system.  To use this monitor, hardware specific io routines must
  7.   be added.   
  8.  
  9.      Definition files required for build:
  10.        rtx2000.f -- defines rtx2000 register as ASIC bus locations
  11.        logic.f -- definitions for TRUE and FALSE
  12.        equal.f -- a definition of =
  13.        shift.f -- definitions of shift instructions 
  14.  
  15.  
  16.      Source ( code defintions ) files required for build:
  17.        main -- Main loop and calls out required modules for build
  18.        debugger -- Actual debugger code
  19.        util -- Support routines for debugger
  20.        gp -- Commonly used FORTH words
  21.        io -- I/O module
  22.   
  23.      Instructions for use:
  24.  
  25.          1- Write I/O specific routines for key, emit, and initio 
  26.            ( These routines comprise the io module )
  27.  
  28.         2- Set the heap and code addresses located in "main" to
  29.            control addresses for code and variables
  30.  
  31.         3- Compile all files together using the command
  32.  
  33.               fc -lexs main
  34.  
  35.            to generate files compatiable with a DATAIO programmer
  36.  
  37.         4- Program PROMS or EEPROMs and install into system
  38.  
  39.         5- Application programs can now be downloaded from a host
  40.            to the RTX2000 system using the monitor.  These application
  41.            programs may call certain routines in the monitor if they
  42.            inclued the file main.x generated when compiling the 
  43.            monitor.
  44.      
  45.      Debugger commands are detailed in the debugger module
  46. )
  47.  
  48.  
  49. ( Debug monitor prompt  )
  50. #macro PROMPT "\nrtx> "
  51.  
  52. ( Include files required for build )
  53. #include rtx2000.f
  54. #include logic.f
  55. #include equal.f
  56. #include shift.f
  57.  
  58. xheap
  59.  
  60. ( Change the heap address from 0xC000 to the desired heap location.
  61.   Variables are allocated by first decrementing the heap then assigning
  62.   the address, so the highest RAM address + 1 makes a good choice for 
  63.   the heap )
  64.  
  65. 0xC000 heap           
  66.  
  67. ( Change the code start address for the desired address of the monitor program 
  68. code.  If PROMs or EEPROMs are available at location 0 and the code is
  69. origined there, the monitor will automatically start-up upon reset )
  70.  
  71. 0x0000  code
  72.  
  73. : main
  74.    -1 slr!             ( initialize stack limit register )
  75.    cr@                 ( read configuration register )
  76.    0x10 or             ( want interrupts disabled )
  77.    0xFFFb and          ( want Motorola mode )
  78.    cr!                 ( set configuration, boot unchanged )
  79.    0 spr!              ( init stack pointer register )
  80.    0 cpr!              ( initialize code page register )
  81.    init_io             ( initialize io )
  82.    debug_init          ( initialize debugger )
  83.    begin
  84.      debugger          ( Call debugger )
  85.    again
  86. ;
  87.  
  88. #include io
  89. #include debugger
  90. #include util
  91. #include gp
  92.  
  93.